import { http } from "@/utils/http/index";

export const addStreaming = (data?: object) => {
  return http.request<any>("post", "/liveStreaming/addStreaming", { data });
};

export const getAllLiveStreaming = () => {
  return http.request<any>("get", "/liveStreaming/getAllLiveStreaming");
};

export const getLiveStreamingRoomInfoByUserId = (params?: object) => {
  return http.request<any>(
    "get",
    "/liveStreaming/getLiveStreamingRoomInfoByUserId",
    { params }
  );
};

export const getLiveStreamingRoomUser = (params?: object) => {
  return http.request<any>(
    "get",
    "/liveStreaming/getLiveStreamingRoomInfoById",
    {
      params
    }
  );
};

export const cancelLiveStreaming = (params?: object) => {
  return http.request<any>("delete", "/liveStreaming/cancelLiveStreaming", {
    params
  });
};

export const updateLiveStreaming = (data?: object) => {
  return http.request<any>("put", "/liveStreaming/updateLiveStreaming", {
    data
  });
};

export const getLiveStreamingRoomChat = (params?: object) => {
  return http.request<any>("get", "/liveStreaming/getLiveStreamingRoomChat", {
    params
  });
};

export const getLiveStreamingRoomOnlineUser = (params?: object) => {
  return http.request<any>("get", "/liveStreaming/getLiveStreamingRoomUser", {
    params
  });
};

export const closeLiveStreamingRoom = (params?: object) => {
  return http.request<any>("get", "/liveStreaming/closeLiveStreamingRoom", {
    params
  });
};

export const getLiveStreamingByStatus = (params?: object) => {
  return http.request<any>("get", "/liveStreaming/getLiveStreamingByStatus", {
    params
  });
};

export const getLiveStreamingListByCourseId = (params?: object) => {
  return http.request<any>(
    "get",
    "/liveStreaming/getLiveStreamingListByCourseId",
    {
      params
    }
  );
};

export const orderLiveStreaming = (params?: object) => {
  return http.request<any>("post", "/liveStreaming/orderLiveStreaming", {
    params
  });
};

export const liveStreamingData = (params?: object) => {
  return http.request<any>("get", "/liveStreaming/liveStreamingData", {
    params
  });
};
